package com.base.common.di

import android.app.Activity
import androidx.fragment.app.FragmentActivity
import com.tbruyelle.rxpermissions3.RxPermissions
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent
import dagger.hilt.android.scopes.ActivityScoped

@Module
@InstallIn(ActivityComponent::class)
class PessimionModule {

    @ActivityScoped
    @Provides
    fun provideRxPermission(activity: Activity?): RxPermissions {
        return RxPermissions((activity as FragmentActivity?)!!)
    }
}